#include "PulseDelaySave.h"

#include <QFile>
#include <QTextStream>
#include <QString>


PulseDelaySave::PulseDelaySave()
{

}

PulseDelaySave::~PulseDelaySave()
{

}

int PulseDelaySave::save(Output output,Pulse *current,MultiLayer multiLayer)
{
  QFile file(output.getFileName());
  QTextStream data(&file);
  file.open(QIODevice::Append);
  data<<current->getSecondPulse()<<"\t";
  data<<multiLayer[multiLayer.getSolveLayer()].getMag().getX()<<"\t";
  data<<multiLayer[multiLayer.getSolveLayer()].getMag().getY()<<"\t";
  data<<multiLayer[multiLayer.getSolveLayer()].getMag().getZ()<<"\t";
  data<<endl;
  file.close();
  return 0;

}
